<?php

class ForeachTag extends SmEngine implements ISmEngine
{
    protected  $_Open = 'foreach';
    protected  $_Close = TRUE;

    function render()
    {
        return '<?php $loop_index = 0; ?>' .
            "\n<?php foreach ($this->_tag): ?>\n" .
            "<?php \$loop_index++; ?>" .
            $this->_content .
            "<?php endforeach; ?>";
    }
}